package com.atguigu.springcloud;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * @ClassName : com.atguigu.springcloud.EurekaMain7001
 * @Description : 类描述
 * Created by cyd on 2021-09-28 19:32:17
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
// 代表本服务是注册中心
@EnableEurekaServer
public class EurekaMain7002 {

    private static ConfigurableApplicationContext context;

    public static void main(String[] args) {
        context = SpringApplication.run(EurekaMain7002.class, args);
        System.out.println("--------------项目启动了---------------");
        ConfigurableEnvironment environment = context.getEnvironment();
        String port = environment.getProperty("server.port");
        System.out.println("port:" + port);
        System.out.println("http://localhost:" + port);
        System.out.println("http://eureka7002.com:" + port);
    }

}
